/* pad.hh
* This file is part of ncursesxx library
* Copyright (c) 2003,2004 by Stanislav Ievlev
*
* This file is covered by the GNU Library General Public License,
* which should be included with libncursesxx as the file COPYING.
*/
#ifndef NCURSESXX_PAD_HH__
#define NCURSESXX_PAD_HH__

#include <curses.h>
#include <ncurses/support.hh>

namespace ncurses
{
	class window;
	/**
	 * This is an abstraction of NCurses Pad feature - big window, which content you
	 * can se via small viewport window. You can use it as an internal big text buffer
	 * for the widgets
	 */
	class pad
	{
	public:
		pad();
		pad(const pad&);
		pad& operator=(const pad&);

		virtual ~pad();
		virtual void resize(unsigned int w, unsigned int h); /**< change size of the pad region */

		unsigned int width() const; /**< @return width of the pad window */
		unsigned int height() const; /**< @return height of the pad window */

		void draw(window& viewport, int x = 0, int y = 0); /**< draw pad's content in viewport's window */
		WINDOW *win() { return pad_; } /**< @return pointer to internal structure */
	protected:
		void swap(pad &other);
		counter counter_; /**< class owner's number */
	private:
		WINDOW	*pad_; /**< pad window */
	};

}

#endif
